﻿using BusinessLogicLayer;
using IBusinessLogicLayer;
using Model.Extend_Model;
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace One.Test.MVC.Controllers
{
    /// <summary>
    ///  学生控制器
    /// </summary>
    public class StudentController : Controller
    {
        /// <summary>
        ///  学生主页
        /// </summary>
        /// <returns></returns>
        public ActionResult Index()
        {
            return View();
        }

        /// <summary>
        ///  学生首页
        /// </summary>
        /// <returns></returns>
        public ActionResult Welcome()
        {
            return View();
        }

        /// <summary>
        ///  学生 -- 个人信息
        /// </summary>
        /// <returns></returns>
        public ActionResult userMessage()
        {
            //获取登录人的用户编号
            var userId = Session["userId"];
            IStudent_ExtendBusinessLogicLayer Sys = new Student_ExtendBusinessLogicLayer();
            List<Student_Extend> StudentList = Sys.GetStudentList();
            SqlParameter[]
                       Parameter = new SqlParameter[]{
                            new SqlParameter("@Id",userId)
                           };

            Student_Extend student = StudentList.FirstOrDefault();
            return View(student);
        }

    }
}
